package com.yookey.caseservice.utils.gongchang;

public class XiaoMiFactory implements AbstractFactory {
    @Override
    public Computer makeComputer() {
        return new MiComputer();
    }

    @Override
    public MobilePhoto makeMobilePhoto() {
        return new MiPhoto();
    }
    public static void main(String[] args) {
        //使用苹果工厂生产苹果公司的系列产品
        AbstractFactory appleFactory=new AppleFactory();
        appleFactory.makeComputer().setOperationSystem();
        appleFactory.makeMobilePhoto().setOperationSystem();

        //使用小米工厂生产小米公司的系列产品
        AbstractFactory miFactory=new XiaoMiFactory ();
        miFactory.makeComputer().setOperationSystem();
        miFactory.makeMobilePhoto().setOperationSystem();

        //使用华为工厂生产华为系列
        AbstractFactory huaFactory = new HuaweiAbstractFactory();
        huaFactory.makeComputer().setOperationSystem();
        huaFactory.makeMobilePhoto().setOperationSystem();
    }

}
